/*
 * Cell.h
 *
 *  Created on: 04/01/2012
 *      Author: luiz
 */

#ifndef CELL_H_
#define CELL_H_

#include <string>

#include "Position.h"

class Cell {

public:

	// this enum define wich function is this cell
    typedef enum{
        NORMAL_CELL_FUNCTION,
        INPUT_CELL_FUNCTION,
        OUTPUT_CELL_FUNCTION,
        FIXED_CELL_FUNCTION} CELL_FUNCTION;
        // this enum define wich clock zone QCA cell can have
        // is defined only 4 clock zones
        typedef enum { CLOCK_ZONE_0=0, CLOCK_ZONE_1=1, CLOCK_ZONE_2=2, CLOCK_ZONE_3=3} CLOCK_ZONE;
        // this enum define at which polarization the cell can have
        typedef enum { POLARIZATION_0=-1, POLARIZATION_1=1} CELL_POLARIZATION;

private:

	// cell identification
	int cell_id_;

	// number of cell's clock zone [0,3]
	CLOCK_ZONE cell_clock_zone_;

	// witch function is this cell
	CELL_FUNCTION cell_function_;

	// store cell position
	Position cell_position_;

	// store cell polarization
	// used only if cell_function is FIXED_CELL_FUNCTION
	CELL_POLARIZATION cell_polarization_;

	// store cell's name
	std::string cell_name_;

public:
	//Constructor

	Cell(int id=0);
	Cell(const Cell& cell);
	Cell& operator=(const Cell& cell);
	virtual ~Cell();

	/*
	 * Get and Set
	 */

	// set cell's function
	// @param CellFunction
	void set_cell_function(CELL_FUNCTION cell_function);

	// get cell's function
	// @return CellFunction
	CELL_FUNCTION cell_function();


	// set cell's id
	// @param int cell_id
	void set_cell_id(int id);


	// get cell_id
	// @return int cell_id
	int cell_id();


	// set cell's clock zone
	// @param ClockZone
	void set_cell_clock_zone(CLOCK_ZONE zone);


	// get cell's clock zone
	// @return ClockZone
	CLOCK_ZONE cell_clock_zone();


	// get cell's position
	// @return Position
	Position cell_position() const;

	// get horizontal position (x axis)
	// @return int position
	int cell_position_horizontal();

	// get vertical position (y axis)
	// @return int position
	int cell_position_vertical();


	// set cell's position
	// @param Position
	void set_cell_position(const Position &position);

	// @param int horizontal position (x axis) and @param int verticial position (y axis)
	void set_cell_position(int horizontal_position, int vertical_position);



    CELL_POLARIZATION cell_polarization() const;


    void set_cell_polarization(CELL_POLARIZATION cellPolarization);

    void set_cell_name(const std::string & name);
    std::string cell_name();


    // print information about cell
	// @return string
	std::string print_cell();





};

#endif /* CELL_H_ */
